home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
WindowPort.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-19
|
4KB
|
137 lines
#ifndef WindowPort_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define WindowPort_First
#include "Port.h"
#include "WindowSystem.h"
class Window;
class Region;
class RGB;
class WindowColorMap;
enum WinState {
eWsHidden, // window allocated but not in hierarchy
eWsShown, // window is inserted in window hierarchy
eWsIconic,
eWsClosed // window will be removed
};
class WindowPort: public Port {
protected:
Window *win;
Token pushbacktoken;
bool havepushbacktoken, overlay, exitloop;
GrCursor cursor;
WinState state;
Region *inval;
Point lastpos;
Rectangle portrect;
WindowColorMap *wcmap;
//---- overridden ----------------------------------------------------
bool DevImageCacheBegin(ImageCache*, Rectangle);
void DevImageCacheEnd(ImageCache*);
//--------------------------------------------------------------------
void OpenNotify(Rectangle r);
void CloseNotify();
public:
MetaDef(WindowPort);
WindowPort(Window *bw, WindowType wt, GrCursor curs);
~WindowPort();
//---- device dependent stuff ----------------------------------------
virtual void DevUpdate();
virtual void DevFullscreen(bool);
virtual void DevScrollRect(Rectangle, Point);
virtual void DevHide();
virtual void DevIconize();
virtual void DevShow(WindowPort *father, Rectangle);
virtual void DevGrab(bool, bool);
virtual void DevGetEvent(Token *t, int timeout, bool overread);
virtual void DevSetMousePos(Point, bool);
virtual void DevBell(long d);
virtual void DevTop(bool);
virtual void DevSetCursor(GrCursor);
virtual void DevSetExtent(Point);
virtual void DevSetOrigin(Point);
virtual Rectangle DevGetRect();
virtual void DevSetTitle(char*);
void DevSetColor(RGBColor *cp);
virtual void DevSetColor2(u_long id);
//---- end of device dependent stuff ---------------------------------
//---- window management ---------------------------------------------
void Top() // bring window to top of window stack
{ DevTop(TRUE); }
void Bottom() // bring window to bottom of window stack
{ DevTop(FALSE); }
void Hide(); // remove a window temporary from the screen
void Show(WindowPort *father, Rectangle, bool block);
// reinsert a previously hidden window
void Iconize();
void UpdateRect(Rectangle &r);
void SetTitle(char *title)
{ DevSetTitle(title); }
//---- size management -----------------------------------------------
Rectangle GetRect()
{ return DevGetRect(); }
void SetOrigin(Point o)
{ DevSetOrigin(o); }
void SetExtent(Point e)
{ DevSetExtent(e); }
//---- scrolling -------------------------------------------------------
void Scroll(Point);
void InvalidateRect(const Rectangle &r, bool update= FALSE);
//---- input handling ------------------------------------------------
void InputNotify(Token *t);
void GetEvent(Token *t, int timeout= -1, bool overread= TRUE);
// read next event
void PushEvent(Token t);
void Grab(bool m, bool fs); // get all input events (fs = fullscreen)
void SetMousePos(Point p) // set the mouse position in window
{ DevSetMousePos(p, FALSE); } // relative coordinates
void MoveMousePos(Point delta) // move the mouse position
{ DevSetMousePos(delta, TRUE); }
void Bell(long d) // ring the bell
{ DevBell(d); }
void GrabLoop();
void Poll(int timeout= 300);
void ExitLoop()
{ exitloop= TRUE; }
WindowColorMap *ColorMap()
{ return wcmap; }
void FlushColorMap();
//---- cursor stuff --------------------------------------------------
GrCursor GetCursor();
GrCursor SetWaitCursor(unsigned int d= 400, GrCursor c= eCrsHourglass);
GrCursor SetCursor(GrCursor);
};
struct batchInfo {
class DevBitmap *b;
Rectangle r;
Point p;
};
#endif